/************************************************************************/
/*    Author: Scott Bevin                                               */
/************************************************************************/

#pragma once

#include "../Property.h"
#include "../PropertyMaker.h"

#include "../../XUtilities/Utilities.h"
#include <assert.h>

namespace XF
{
	class BoolProperty : public Prop<bool>
	{
	public:
		BoolProperty(std::string typeID, const std::string &name) : Prop<bool>(typeID, name){}

		std::string ToString()
		{
			return (mData.mValue ? "true" : "false");
		}

		void SetFromString(std::string value)
		{
			if(value == "true" || value == "True")
				mData.mValue = true;
			else if(value == "false" || value == "False")
				mData.mValue = false;
			else
			{
				assert(false && "BoolProperty:SetFromString: Invalid input: ");
			}
		}

	private:
		static PropertyMaker<BoolProperty, bool> mRegisterThis;
	};
}